<?php
session_start();
header('content-type:text/html;charset=utf-8');
if($_SESSION['authority']!=1)
	header('location:../index.php');
if($_POST['sub']){
	include '../class/user.class.php';
	$user=new User;
	$bool=$user->createUser($_POST['username'],$_POST['pass']);
	if($bool)
		die('创建成功');
	else
		die('创建失败');
}
?>
<table border="0">
	<caption><h1>用户注册</h1></caption>
	<forms action="regedit.php" method="post" accept-charset="utf-8">
	<tr>
		<td>用户名：</td>
		<td><input id="username" type="text" name="username" placeholder="username"></td>
		<td id="username_check" style="width:300px">用户名只能是字母，数字，或者下划线组成的6-20位</td>
	</tr>
	<tr>
		<td>密&nbsp;&nbsp;码：</td>
		<td><input id="password" type="password" placeholder="password"></td>
		<td id="ps">密码只能由数字、字母、下划线组成的6-20位</td>
	</tr>
	<tr>
		<td>确认密码：</td>
		<td><input id="ps_check" type="password" name="pass" placeholder="password again"></td>
		<td id="ps_double_check">请确认密码</td>
	</tr>
	<!--头像由用户自行添加-->
	<tr>
		<td colspan="3" style="text-align:center"><input type="submit" id="sub" name="sub" class="btn btn-primary disabled" onclick="return false" value="提交"></td>
	</tr>
	</forms>
</table>
